import { request } from '@/utils/request';
import CRUD from '@/utils/request/CRUD';

// 基础订单CRUD
export const basicOrderCRUD = CRUD('/system/order');

// 获取订单相关人员
export function getOrderRelevantPerson(params: Record<string, any>) {
  return request.get({
    url: '/system/order/get-order-staff',
    params,
  });
}

// 转派客服
export function transferSale(data: Record<string, any>) {
  return request.post({
    url: '/system/order/update-sale',
    data,
  });
}

// 转派设计师
export function transferDesigner(data: Record<string, any>) {
  return request.post({
    url: '/system/order/update-designer',
    data,
  });
}

// 设置客户等级
export function setCustomerLevel(data: Record<string, any>) {
  return request.post({
    url: '/system/order/set-customer-level',
    data,
  });
}

// 获取客户标签分页
export function getCustomerLabelPage(params: Record<string, any>) {
  return request.get({
    url: '/system/customer-label/page',
    params,
  });
}

// 设置客户标签
export function setCustomerLabel(data: Record<string, any>) {
  return request.post({
    url: '/system/customer-label/create-batch',
    data,
  });
}
export function setProduct(data: Record<string, any>) {
  return request.post({
    url: '/system/product-contract-pay-log/insert-pay-log',
    data,
  });
}
export function setEngineering(data: Record<string, any>) {
  return request.post({
    url: '/system/engineering-accounting-expenses/insert-manual-fee',
    data,
  });
}
export function setSendNotice(data: Record<string, any>) {
  return request.post({
    url: '/system/product-contract/send-notice',
    data,
  });
}

// 废单恢复
export function restoreOrder(data: Record<string, any>) {
  return request.post({
    url: '/system/order/order-restore',
    data,
  });
}